home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
How Would You Survive?
/
How Would You Survive (1995)(Grolier)[Mac-PC].iso
/
pc
/
shared.dir
/
01978_Script_aBiStableButton
< prev
next >
Wrap
Text File
|
1995-09-13
|
2KB
|
97 lines
property pSprite , pNCast , pHCast , pDCast , pFunction , pLatched, pCursor, pMySound, pRolloverFunction
on birth me , theSprite , theNCast, theSound, theFunction, theCursor, theRolloverFunction
set pSprite = theSprite
set pNCast = theNCast
set pHCast = pNCast + 1
set pDCast = pNCast + 2
set pFunction = theFunction
set pRolloverFunction = theRolloverFunction
set pCursor = theCursor
set pMySound = theSound
puppetSprite pSprite , TRUE
set pLatched = FALSE
return me
end
on normalState me
set pLatched = FALSE
set the castNum of sprite pSprite = pNCast
upDateStage
end
on hilightState me
set the castNum of sprite pSprite = pHCast
upDateStage
end
on downState me
set pLatched = TRUE
set the castNum of sprite pSprite = pDCast
upDateStage
end
on setlatched me
set pLatched = TRUE
set the castNum of sprite pSprite = pHCast
upDateStage
end
on getState me
return (the castNum of sprite pSprite)
end
on testRollover me
if (rollover(pSprite)) then
set ret = TRUE
else
set ret = FALSE
end if
return ret
end
on hilight me
if (not(pLatched)) then
if (testRollover ( me)) then
if ( getState (me) = pNCast) then
hilightState (me)
do pRolloverFunction
end if
if (the mouseDown) then
puppetsound pMySound
clearAll
downState (me)
do pFunction
end if
else
normalState(me)
end if
end if
end
on hilight2 me
if (not(pLatched)) then
if (testRollover ( me)) then
if ( getState (me) = pNCast) then
hilightState (me)
end if
if (the mouseDown) then
puppetsound 0
puppetsound pMySound
updatestage
clearAll
downState (me)
do pRolloverFunction
do pFunction
end if
else
normalState(me)
end if
end if
end
on reset me
normalState(me)
end